package com.itheima.stock.controller;


import com.itheima.stock.pojo.SysRole;
import com.itheima.stock.service.RoleService;
import com.itheima.stock.vo.resp.PageResult;
import com.itheima.stock.vo.resp.R;
import com.itheima.stock.vo.resp.RoleJiaZai;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api")
public class RoleController {

    @Autowired
    private RoleService roleService;

    @PostMapping("/roles")
    public R<PageResult<SysRole>> getRole(@RequestBody RoleJiaZai roleJiaZai) {
        R<PageResult<SysRole>> role = roleService.findRole(roleJiaZai);
        return role;
    }

}
